package chapter01.d02;

public class TicketThread1 extends Thread {
	private int ticket = 5;
	private String window;

	public TicketThread1(String window) {
		super(window);
		this.window = window;
	}

	@Override
	public void run() {
		for (int i = 0; i < 1000; i++) {
			if (ticket > 0) {
				System.out.println(window + "\t剩余火车票数：" + ticket--);

			}
		}
	}
}